package com.zzyl.nursing.domain;

import com.zzyl.common.annotation.Excel;
import com.zzyl.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 床位对象 bed
 * 
 * @author ruoyi
 * @date 2024-04-26
 */
@Data
@ApiModel("床位实体对象")
public class Bed extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 床位ID */
    @ApiModelProperty(value = "床位ID")
    private Long id;

    /** 床位编号 */
    @Excel(name = "床位编号")
    @ApiModelProperty(value = "床位编号")
    private String bedNumber;

    /** 床位状态: 未入住0, 已入住1 入住申请中2 */
    @Excel(name = "床位状态: 未入住0, 已入住1 入住申请中2")
    @ApiModelProperty(value = "床位状态: 未入住0, 已入住1 入住申请中2")
    private Integer bedStatus;

    /** 床位号 */
    @Excel(name = "床位号")
    @ApiModelProperty(value = "床位号")
    private Long sort;

    /** 房间ID */
    @Excel(name = "package com.zzyl.nursing.controller;\n" +
            "\n" +
            "import com.zzyl.common.annotation.Log;\n" +
            "import com.zzyl.common.core.controller.BaseController;\n" +
            "import com.zzyl.common.core.domain.AjaxResult;\n" +
            "import com.zzyl.common.core.domain.R;\n" +
            "import com.zzyl.common.core.page.TableDataInfo;\n" +
            "import com.zzyl.common.enums.BusinessType;\n" +
            "import com.zzyl.nursing.domain.Bed;\n" +
            "import com.zzyl.nursing.service.IBedService;\n" +
            "import io.swagger.annotations.Api;\n" +
            "import io.swagger.annotations.ApiOperation;\n" +
            "import io.swagger.annotations.ApiParam;\n" +
            "import org.springframework.beans.factory.annotation.Autowired;\n" +
            "import org.springframework.security.access.prepost.PreAuthorize;\n" +
            "import org.springframework.web.bind.annotation.*;\n" +
            "\n" +
            "import java.util.List;\n" +
            "\n" +
            "/**\n" +
            " * 床位Controller\n" +
            " * \n" +
            " * @author ruoyi\n" +
            " * @date 2024-04-26\n" +
            " */\n" +
            "@RestController\n" +
            "@RequestMapping(\"/elder/bed\")\n" +
            "@Api(tags =  \"床位相关接口\")\n" +
            "public class BedController extends BaseController\n" +
            "{\n" +
            "    @Autowired\n" +
            "    private IBedService bedService;\n" +
            "\n" +
            "    /**\n" +
            "     * 查询床位列表\n" +
            "     */\n" +
            "    @PreAuthorize(\"@ss.hasPermi('elder:bed:list')\")\n" +
            "    @GetMapping(\"/list\")\n" +
            "    @ApiOperation(\"查询床位列表\")\n" +
            "    public TableDataInfo list(Bed bed)\n" +
            "    {\n" +
            "        startPage();\n" +
            "        List<Bed> list = bedService.selectBedList(bed);\n" +
            "        return getDataTable(list);\n" +
            "    }\n" +
            "\n" +
            "    /**\n" +
            "     * 获取床位详细信息\n" +
            "     */\n" +
            "    @PreAuthorize(\"@ss.hasPermi('elder:bed:query')\")\n" +
            "    @GetMapping(value = \"/{id}\")\n" +
            "    @ApiOperation(\"获取床位详细信息\")\n" +
            "    public R<Bed> getInfo(@ApiParam(value = \"床位ID\", required = true)  @PathVariable(\"id\") Long id)\n" +
            "    {\n" +
            "        return R.ok(bedService.selectBedById(id));\n" +
            "    }\n" +
            "\n" +
            "    /**\n" +
            "     * 新增床位\n" +
            "     */\n" +
            "    @PreAuthorize(\"@ss.hasPermi('elder:bed:add')\")\n" +
            "    @Log(title = \"床位\", businessType = BusinessType.INSERT)\n" +
            "    @PostMapping\n" +
            "    @ApiOperation(\"新增床位\")\n" +
            "    public AjaxResult add(@RequestBody Bed bed)\n" +
            "    {\n" +
            "        return toAjax(bedService.insertBed(bed));\n" +
            "    }\n" +
            "\n" +
            "    /**\n" +
            "     * 修改床位\n" +
            "     */\n" +
            "    @ApiOperation(\"修改床位\")\n" +
            "    @PreAuthorize(\"@ss.hasPermi('elder:bed:edit')\")\n" +
            "    @Log(title = \"床位\", businessType = BusinessType.UPDATE)\n" +
            "    @PutMapping\n" +
            "    public AjaxResult edit(@RequestBody Bed bed)\n" +
            "    {\n" +
            "        return toAjax(bedService.updateBed(bed));\n" +
            "    }\n" +
            "\n" +
            "    /**\n" +
            "     * 删除床位\n" +
            "     */\n" +
            "    @ApiOperation(\"删除床位\")\n" +
            "    @PreAuthorize(\"@ss.hasPermi('elder:bed:remove')\")\n" +
            "    @Log(title = \"床位\", businessType = BusinessType.DELETE)\n" +
            "\t@DeleteMapping(\"/{ids}\")\n" +
            "    public AjaxResult remove(@ApiParam(value = \"床位ID\", required = true)  @PathVariable Long[] ids)\n" +
            "    {\n" +
            "        return toAjax(bedService.deleteBedByIds(ids));\n" +
            "    }\n" +
            "}\n")
    @ApiModelProperty(value = "房间ID")
    private Long roomId;

}
